
var images = document.getElementsByTagName( 'img' );
var imagesUrl = new Array();
var selectedText = window.getSelection().toString();
for( var index = 0, picture, scale, pWidth, pHeight; index < images.length; index++ ) {
	picture = images[index];
	picture.removeAttribute( "width" ); 
	picture.removeAttribute( "height" );
	
	pWidth = picture.width;
	pHeight = picture.height;
	if( pWidth && pHeight )
		if( pWidth * pHeight > 3000 ) {
			imagesUrl.push( images[index].src ); }
}
	
if( imagesUrl.length > 0 || selectedText )
	chrome.extension.sendRequest({ "validation": "page-script", "imagesArray": imagesUrl, "selectedText": selectedText });
